﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Browser;

namespace Sample03_Scene
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }
        int index = 4;
        void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            var Document = HtmlPage.Document;
            if (Document.QueryString.ContainsKey("index"))
                index = Convert.ToInt32(Document.QueryString["index"]);
            Loaded -= MainPage_Loaded;
            switch (index)
            {
                case 1:
                    Content = new Sample_1();
                    break;
                case 2:
                    Content = new Sample_2();
                    break;
                case 3:
                    Content = new Sample_3();
                    break;
                case 4:
                    Content = new Sample_4();
                    break;
                default:
                    break;
            }
            
        }
    }
}
